package org.mch.func.m_px.yunsf;

import java.awt.event.MouseEvent;

import org.mch.biz.ui.BizEvent;
import org.mch.biz.ui.BizPanel;

/**
 * 描述：按位 左移 右移 事件类；<BR/>
 * 
 * @author MCH；<BR/>
 *
 */
public class ErJinZhiJiSuan_Event extends BizEvent {
	private static final long serialVersionUID = 5298494039238554644L;

	public ErJinZhiJiSuan_Event(BizPanel panel) {
		super(panel);
	}

	@Override
	protected void buttonClicked(MouseEvent e) throws Exception {
		if (e.getSource() == getPanel().getBtn_jisuan()) {
			onJiSuan();// 计算
		}

	}

	private void onJiSuan() {
		String ejz_str = getPanel().getText_erjinzhi().getValue();

		long l = Long.parseLong(ejz_str, 2);

		getPanel().getText_jieguo().setValue(l);
	}

	@Override
	public ErJinZhiJiSuan_Panel getPanel() {
		return (ErJinZhiJiSuan_Panel) super.getPanel();
	}
}
